package cn.yangliu.nacos.management.entity.oauth2;

import java.time.LocalDateTime;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import cn.yangliu.nacos.comm.audit.AbstractEntity;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * The type of nacos.
 *
 * @author 问道于盲
 * @date 2020 -01-01
 */
@Entity
@Table(name = "oauth2_user")
@Data
public class Oauth2User extends AbstractEntity {

    /**
     * current class's static member
     * The constant serialVersionUID.
     */
    private static final long serialVersionUID = 1L;

    /**
     * current class instance's member.
     * The Username.
     */
    @Column(updatable = false, unique = true)
    @ApiModelProperty("用户名")
    private String username;

    /**
     * current class instance's member.
     * The Password.
     */
    @Column(updatable = false)
    @JsonIgnore
    private String password;

    /**
     * current class instance's member.
     * The Email.
     */
    @ApiModelProperty("邮箱")
    private String email;

    /**
     * current class instance's member.
     * The Mobile.
     */
    @ApiModelProperty("电话")
    private String mobile;

    /**
     * current class instance's member.
     * The Account expire time.
     */
    @ApiModelProperty("账户过期时间")
    private LocalDateTime accountExpireTime = LocalDateTime.MIN;

    /**
     * current class instance's member.
     * The Enable.
     */
    @ApiModelProperty("是否可用")
    private Boolean enable = true;

    /**
     * current class instance's member.
     * The Last password update time.
     */
    @ApiModelProperty("上次密码修改时间")
    private LocalDateTime lastPasswordUpdateTime;
}
